package com.zbkj.crmeb.store.model;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.zbkj.crmeb.store.FeatureBaseDO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 订单购物详情表
 * </p>
 *
 * @author Mr.Zhang
 * @since 2020-05-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("eb_store_order_info")
@ApiModel(value="StoreOrderInfo对象", description="订单购物详情表")
public class StoreOrderInfo extends FeatureBaseDO implements Serializable {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "订单id")
    private Integer orderId;

    @ApiModelProperty(value = "商品ID")
    private Integer productId;

    @ApiModelProperty(value = "购买东西的详细信息")
    private String info;

    @ApiModelProperty(value = "唯一id")
    @TableField(value = "`unique`")
    private String unique;

    @ApiModelProperty(value = "商品订单号")
    private String orderInfoId;

    @ApiModelProperty(value = "供应商Id")
    private Integer suppliersId;

    @ApiModelProperty(value = "推送地址")
    private String deliveryAddress;

    @ApiModelProperty(value = "子订单号")
    private String childOrderNumber;

    @ApiModelProperty(value = "订单状态(-3:补偿性退款 -2:退货退款 -1:退款申请中 0:待支付 1:待发货 2:待收货 3:待评价 4:已完成 5:已取消 6:待确认)")
    private Integer status;

    @ApiModelProperty(value = "0 未退款 1 申请中 2 已退款 3 补偿性退款 ")
    private Integer refundStatus;

    @ApiModelProperty(value = "退款图片")
    private String refundReasonWapImg;

    @ApiModelProperty(value = "退款用户说明")
    private String refundReasonWapExplain;

    @ApiModelProperty(value = "退款时间")
    private Date refundReasonTime;

    @ApiModelProperty(value = "前台退款原因")
    private String refundReasonWap;

    @ApiModelProperty(value = "不退款的理由")
    private String refundReason;

    @ApiModelProperty(value = "退款金额")
    private BigDecimal refundPrice;

    @ApiModelProperty(value = "是否删除 0正常 1删除 ")
    private Integer isDel;

    @ApiModelProperty(value = "自提校验码")
    private String verifyCode;

    @ApiModelProperty(value = "实际支付金额")
    private BigDecimal payPrice;

    @ApiModelProperty(value = "抵扣金额")
    private BigDecimal deductionPrice;

    @ApiModelProperty(value = "是否异常订单（0正常 1异常）")
    private Integer abnormal;

    @ApiModelProperty(value = "实际供应商id")
    private Integer actualSupplierId;

    @ApiModelProperty(value = "实际成本价")
    private BigDecimal actualCost;

    @ApiModelProperty(value = "实际成本价(欧元)")
    private BigDecimal actualCostEur;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "下单汇率")
    private BigDecimal exchangeRate;

    @ApiModelProperty(value = "物流方式  0：默认自行发货，1：平台物流（物流部门未操作），2：海外直邮，3：跨境转运")
    private Integer logisticsType;

    @ApiModelProperty(value = "头程物流费用")
    private BigDecimal firstPrice;

    @ApiModelProperty(value = "终端物流费用")
    private BigDecimal secondPrice;

    @ApiModelProperty(value = "税费")
    private BigDecimal taxPrice;

    @ApiModelProperty(value = "实际运税费")
    private BigDecimal actualTaxAndSecondPrice;

    @ApiModelProperty(value = "最终发货地")
    private Integer actualStockAreaCode;

    @ApiModelProperty(value = "是否自建;1:自建；其它(包括null)：云仓")
    private Integer isEurope;

    @ApiModelProperty(value = "国际运费")
    private BigDecimal taxInternationalPrice;
    @ApiModelProperty(value = "转国内运费")
    private BigDecimal taxTurnInlandPrice;
    @ApiModelProperty(value = "国内运税费")
    private BigDecimal taxInlandDeliveryPrice;
    @ApiModelProperty(value = "税金")
    private BigDecimal taxTaxesPrice;

    @ApiModelProperty(value = "优惠券抵扣金额")
    private BigDecimal couponPrice;

    @ApiModelProperty(value = "一级服务商利润")
    private BigDecimal firstAgentProfit;

    @ApiModelProperty(value = "二级服务商利润")
    private BigDecimal secondAgentProfit;

    @ApiModelProperty(value = "是否自建全新商品1全新，0二手")
    private Integer newProductFlag;

    @ApiModelProperty(value = "云仓商品自主发货（0平台发货 1自主发货）")
    private Integer autonomous;

    @ApiModelProperty(value = "关键字")
    private String keyword;

    @ApiModelProperty(value = "商品名称")
    private String storeName;

    @ApiModelProperty(value = "分类id")
    private Integer cateId;

    @ApiModelProperty(value = "会员优惠价格")
    private BigDecimal vipReducePrice;

    @ApiModelProperty(value = "批采商品id")
    private Integer pickingProductId;

    @ApiModelProperty(value = "数量")
    @TableField(exist = false)
    private Integer num;

    @ApiModelProperty(value = "虚拟子订单")
    @TableField(exist = false)
    private Boolean isVirtual;

    @ApiModelProperty(value = "活动id")
    private Integer activityId;
    
    @ApiModelProperty(value = "是否推送保税仓")
    private Boolean isWzbsc;
    
    @ApiModelProperty(value = "是否推送菜鸟中心仓")
    private Boolean isCainiao;

    @ApiModelProperty(value = "菜鸟返回的运单号")
    private String cnOrderCode;

    @ApiModelProperty(value = "是否推送到溯源系统")
    private Boolean isPushTs;

    @ApiModelProperty(value = "溯源二维码")
    private String qrCode;

    @ApiModelProperty(value = "平台加价率")
    private BigDecimal realPlatRatio;

    @ApiModelProperty(value = "供应商加价率")
    private BigDecimal suppliersRatio;

    @ApiModelProperty(value = "推送仓code，详见StoreCodeEnums")
    private String pushStoreCode;

    @ApiModelProperty(value = "扩展字段")
    private String feature;

    @ApiModelProperty(value = "真拼团活动id")
    @TableField(exist = false)
    private Integer activityGroupId;

    @ApiModelProperty(value = "用户UID")
    @TableField(exist = false)
    private Integer uid;


    @Override
    protected void resetFeature() {
        feature = JSONObject.toJSONString(getFeatureMap());
    }

    @Override
    protected String getFeatureString() {
        return feature;
    }
}
